# -*- coding:utf-8 -*-
# @FileName  :dhcc_ent_queryreason.py
# @Time      :2020/12/9 9:49
# @Author    :Zhoujirong
# @Desc      : 企业查询原因
import parameterized
from biz.flow.ent_queryreason import EntQueryReasonRequest
from common.log import Log
from biz.cases.base_case import BaseCase
from common.params_operator import Param

class TestEntQueryReason(BaseCase):
    @classmethod
    def setUpClass(cls):
        cls.cookie = BaseCase().get_token()
    @parameterized.parameterized.expand(Param.from_excel('ent_query_reason_data.xls'))
    def test_get_page(self,curPage,maxSize,search_EQ_queryReason,check,desc):
        self._testMethodDoc = desc
        ret = EntQueryReasonRequest.get_page(curPage,maxSize,search_EQ_queryReason,self.cookie)
        Log.info(ret)
        self.assertEqual(check,ret.list[0].queryReason)

    def test_a_stop(self):
        '''停用查询原因'''
        id = '06'
        ret = EntQueryReasonRequest.stop(id,self.cookie)
        Log.info(ret)
        self.assertEqual('00000000',ret.code)
        self.assertIn('操作成功',ret.msg)

    def test_b_start(self):
        '''启用查询原因'''
        id = '06'
        ret = EntQueryReasonRequest.start(id,self.cookie)
        Log.info(ret)
        self.assertEqual('00000000', ret.code)
        self.assertIn('操作成功', ret.msg)

    @parameterized.parameterized.expand(Param.from_excel('ent_query_reason_level_data.xls'))
    def test_level(self,id,approvalLevel,check,desc):
        '''审批级别设置'''
        self._testMethodDoc = desc
        ret = EntQueryReasonRequest.level(id,approvalLevel,self.cookie)
        Log.info(ret)
        self.assertIn(check,ret.msg)








if __name__ == "__main__":
    pass